#include "app_buffer.h"
#include "log/log.h"

int main()
{
    Buffer_t *buffer = app_buffer_init(14);

    // 写入数据1
    app_buffer_write(buffer, "abcde", 5);
    // 写入数据2
    app_buffer_write(buffer, "fghijk", 6);

    // 读取数据1
    char data_buf1[10];
    int len1 = app_buffer_read(buffer, data_buf1, 10);
    log_debug("读取数据1长度：%d，内容：%.*s", len1, len1, data_buf1);

    // 读取数据2
    char data_buf2[10];
    int len2 = app_buffer_read(buffer, data_buf2, 10);
    log_debug("读取数据2长度：%d，内容：%.*s", len2, len2, data_buf2);
    return 0; 
}